package com.iran.visitor;

import java.util.ArrayList;

public class ObjectStructure {
    ArrayList<Element> elements = new ArrayList<>();

    public void add(Element element){
        elements.add(element);
    }
    public void remove(Element element){
        elements.remove(element);
    }
    public void accept(Visitor visitor){
        elements.forEach(d->{
            d.accept(visitor);
        });
    }
}
